import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export const listUser = (data) => request({
    url: baseUrl + '/sys/sysUser/page',
    method: 'post',
    data: data
});

export const listDept = () => request({
    url: baseUrl + '/sys/sysDepartment/userList',
    method: 'get',
});

export const listRole = (data) => request({
    url: baseUrl + '/sys/sysRole/'+data.act+'/'+data.userId,
    method: 'get',
});
export const addUser = (data) => request({
    url: baseUrl + '/sys/sysUser',
    method: 'post',
    data: data
});

export const startUser = (data) => request({
    url: baseUrl + '/sys/sysUser/start',
    method: 'put',
    params: data
});

export const delUser = (ids) => request({
    url: baseUrl + '/sys/sysUser/' + ids,
    method: 'delete',
});
export const updateUser = (data) => request({
    url: baseUrl + '/sys/sysUser',
    method: 'put',
    data: data
});
export const updateCurrentUser = (data) => request({
    url: baseUrl + '/sys/sysUser/updateUser',
    method: 'put',
    data: data
});
export const reset = (data) => request({
    url: baseUrl + '/sys/sysUser/reset',
    method: 'put',
    params: data
});

